package myApp.KnorrAndroid.view.common;

import myApp.Constant.ActionEventConstant;
import myApp.KnorrAndroid.R;
import myApp.KnorrAndroid.common.ActionEvent;
import myApp.KnorrAndroid.controller.UserController;
import myApp.KnorrAndroid.view.KnorrBaseActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

public class HomeView extends KnorrBaseActivity implements android.view.View.OnClickListener{
	
	LinearLayout llMenuLogin;//button dang nhap - dang ky
	LinearLayout llMenuDishSearch; // seach mon an
	LinearLayout llMenuDishMenu; //thuc don mon an
	LinearLayout llMenuHelp; // tro giup
	LinearLayout llMenuIntro; // gioi thieu
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_home_view);
		llMenuLogin = (LinearLayout)findViewById(R.id.llMenuLogin);
		llMenuDishSearch = (LinearLayout)findViewById(R.id.llMenuDishSearch);
		llMenuDishMenu = (LinearLayout)findViewById(R.id.llMenuDishMenu);
		llMenuHelp = (LinearLayout)findViewById(R.id.llMenuHelp);
		llMenuIntro = (LinearLayout)findViewById(R.id.llMenuIntro);
		llMenuLogin.setOnClickListener(this);
		llMenuDishSearch.setOnClickListener(this);
		llMenuDishMenu.setOnClickListener(this);
		llMenuHelp.setOnClickListener(this);
		llMenuIntro.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.llMenuLogin:
			gotoLoginView();
			break;

		default:
			break;
		}
	}

	private void gotoLoginView(){
		Bundle bundle = new Bundle();
		ActionEvent e = new ActionEvent();
		e.sender = HomeView.this;
		e.viewData = bundle;
		e.action = ActionEventConstant.GO_TO_LOGIN_VIEW;
		UserController.getInstance().handleSwitchActivity(e);
	}
}
